
// <copyright file="AbstractDummyConnection.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The abstract dummy connection.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Data.Common
{
    using System.Data;

    /// <summary>
    /// The abstract dummy connection.
    /// </summary>
    public abstract class AbstractDummyConnection : AbstractDisposable, IDbConnection
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the connection string.
        /// </summary>
        public string ConnectionString { get; set; }

        /// <summary>
        /// Gets or sets the connection timeout.
        /// </summary>
        public int ConnectionTimeout { get; set; }

        /// <summary>
        /// Gets the database.
        /// </summary>
        public string Database
        {
            get
            {
                return string.Empty;
            }
        }

        /// <summary>
        /// Gets the state.
        /// </summary>
        public ConnectionState State
        {
            get
            {
                return ConnectionState.Open;
            }
        }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The begin transaction.
        /// </summary>
        /// <param name="il">
        /// The il.
        /// </param>
        /// <returns>
        /// The <see cref="IDbTransaction"/>.
        /// </returns>
        public IDbTransaction BeginTransaction(IsolationLevel il)
        {
            return null;
        }

        /// <summary>
        /// The begin transaction.
        /// </summary>
        /// <returns>
        /// The <see cref="IDbTransaction"/>.
        /// </returns>
        public IDbTransaction BeginTransaction()
        {
            return null;
        }

        /// <summary>
        /// The change database.
        /// </summary>
        /// <param name="databaseName">
        /// The database name.
        /// </param>
        public void ChangeDatabase(string databaseName)
        {
        }

        /// <summary>
        /// The close.
        /// </summary>
        public void Close()
        {
        }

        /// <summary>
        /// The create command.
        /// </summary>
        /// <returns>
        /// The <see cref="IDbCommand"/>.
        /// </returns>
        public abstract IDbCommand CreateCommand();

        /// <summary>
        /// The open.
        /// </summary>
        public void Open()
        {
        }

        #endregion Public Methods and Operators

        #region Methods

        /// <summary>
        /// The dispose.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected override void Dispose(bool disposing)
        {
        }

        #endregion Methods
    }
}